home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / patches / tw207221.lha / UpdateTwist2 < prev    next >
Text File  |  1995-07-14  |  3KB  |  93 lines

  1. ;$VER: Twist_Patcher 2.21 (14.7.95)
  2. ;Twist update script
  3.  
  4. (set patchver (getversion "UpdateTwist2"))
  5. (set patchver$ (cat (/ PATCHVER 65536) "." (- PATCHVER (* (/ PATCHVER 65536) 65536))) )
  6.  
  7. (user 2)
  8.  
  9. (Message "\n\nThis is the freely distributable patch for Twist 2 Amiga (English language),"
  10. " this patch utility requires the correct patch for your version of Twist (See the About Box in Twist 2) and"
  11. " the original Twist 2 distribution disk.\n\nNOTE: This patch will not work on\ninstalled versions of Twist."
  12. )
  13.  
  14. (Message "\nInsert a backup copy of your Twist\nmaster disk in drive DF0:\n\n"
  15. "**********************************\n"
  16. "\nWarning: This disk will be\naltered by the update utility\n\n"
  17. "**********************************"
  18. )
  19.  
  20. (PROCEDURE CHOOSEPATCH
  21.  
  22. (Working "\nChecking current version\n\nPlease Wait...")
  23. (set currentver (getversion "DF0:Twist/Twist2"))
  24.  
  25. (if (AND (>= (- CURRENTVER (* (/ CURRENTVER 65536) 65536)) 1) (<= (- CURRENTVER (* (/ CURRENTVER 65536) 65536)) 9))
  26. (set currentver$ (cat (/ CURRENTVER 65536) ".0" (- CURRENTVER (* (/ CURRENTVER 65536) 65536))))
  27. (set currentver$ (cat (/ CURRENTVER 65536) "." (- CURRENTVER (* (/ CURRENTVER 65536) 65536))))
  28. )
  29.  
  30. (set patchfile (cat "Patch" currentver$))
  31.  
  32.  
  33. (debug currentver currentver$ patchfile)
  34.  
  35.  
  36.                                                                                                                                                                                                )
  37. (PROCEDURE CHECKVER
  38.  
  39.     (If (<> (exists patchfile) 1)
  40.  
  41.         (
  42.  
  43.         (If (= patchver$ currentver$)
  44.             (
  45.             (Message ("\nThe latest version(%s) is already installed" currentver$))
  46.             (EXIT (QUIET))
  47.             )
  48.         )
  49.  
  50.         (Message ("\nIncorrect patch file you require\nthe %s to %s patch" currentver$ patchver$))
  51.         (EXIT (QUIET))
  52.  
  53.         )
  54.     )
  55.  
  56. )
  57. (PROCEDURE RUNPATCH
  58.  
  59. (if (< currentver patchver)
  60.  
  61.     (
  62.     (Working ("You have version %s of Twist\n\nPatching Twist to version %s Please wait"  currentver$ patchver$))
  63.     (run ("spatch -oram:TwistNew -p%s DF0:Twist/Twist2" patchfile))
  64.  
  65.     (If (= (exists "RAM:TwistNew") 1)
  66.  
  67.         (
  68.  
  69.         (copyfiles
  70.         (source "RAM:TwistNew")
  71.         (dest "DF0:Twist")
  72.         (newname "Twist2")
  73.         (optional "force" "nofail")
  74.         )
  75.         (delete "RAM:TwistNew")
  76.         (Message "Patch has been successful. \n\nRe-install the new version of\nTwist from the updated disk")
  77.         )
  78.  
  79.         (Message "Patch has failed, contact tech support for an update disk")
  80.  
  81.     )
  82.  
  83.     )
  84.  
  85.     (Message "Incompatible patch file, contact tech support for an update disk")
  86.  
  87. )
  88.  
  89. )
  90.  
  91. (CHOOSEPATCH)
  92. (CHECKVER)
  93. (RUNPATCH)